/**
 * 引入封装的request请求
 * author：lvguowei
 */
const {
  request
} = require('./requests')
const {
  tokenRequest
} = require('./requests')

/**
 * 封装业务接口
 */
module.exports = {
  
  // 微信登陆
  wxLogin: (data) => {
    return request('wxauth/wxlogin', 'POST', data)
  },
  // 微信认证
  weChatAuthentication: (data) => {
    return request('wxauth/login', 'POST', data)
  },
  // 获取大会新闻
  getMeetingNews: () => {
    return request('xhlj/news/list', 'GET', "")
  },
  getMeetingPeople: () =>{
    return request('xhlj/participants/list', 'GET', "")
  },
  // 查询活动列表
  getActivityList: (activityType) => {
    const url = `xhlj/activity/list?activityType=${activityType}`;
    return tokenRequest(url, 'GET','')
  },
  // 查询活动列表
  getActivityAllList: () => {
    const url = `xhlj/activity/allList`;
    return tokenRequest(url, 'GET','')
  },
  // 查询活动列表
  getActivityByPageSize: (pageSize) => {
    const url = `xhlj/activity/list?pageSize=${pageSize}`;
    return tokenRequest(url, 'GET','')
  },
  // 获取大会亮点
  getMeetingHighlight: () => {
    return tokenRequest('xhlj/highlight/list', 'GET', '')
  },
  // 获取讨论列表
  getDiscussionList: () => {
    return tokenRequest('xhlj/discussion/list', 'GET', '')
  },
  // 获取活动详情
  getActivityById: (activityId) => {
    const url = `xhlj/activity/${activityId}`;
    return tokenRequest(url, 'GET', '');
  },
  // 获取活动议程
  getActivityAgendaList: (activityId) => {
    const url = `xhlj/activityAgenda/${activityId}`;
    return tokenRequest(url, 'GET', '');
  },
  // 获取历年大会
  getConferenceInfoList: () => {
    return tokenRequest('xhlj/conferenceInfo/list', 'GET', '')
  },
  //关于大会
  getConferenceById: (conferenceInfoId) => {
    const url = `xhlj/conferenceInfo/${conferenceInfoId}`;
    return tokenRequest(url, 'GET', '');
  },
  // 获取亮点
  getHighlightList: () => {
    return tokenRequest('xhlj/highlight/list', 'GET', '')
  },
  // 获取大会精彩瞬间（图片）
  getWonderfulImageList: () => {
    return tokenRequest('xhlj/wonderfulImage/list', 'GET', '')
  },
  // 获取大会精彩瞬间（视频）
  getWonderfulVideoList: () => {
    return tokenRequest('xhlj/wonderfulVideo/list', 'GET', '')
  },
  //任务（奖励互动）
  getInteraction: () => {
    return tokenRequest('xhlj/activityTask/list', 'GET', '')
  },
  //获取展商列表
  getEnterpriseList: () => {
    return tokenRequest('xhlj/enterprise/list', 'GET', '')
  },
  //获取展商详情
  getEnterpriseById: (enterpriseId) => {
    const url = `xhlj/enterprise/${enterpriseId}`;
    return tokenRequest(url, 'GET', '')
  },

  //获取话题标签列表
  getTopicTagsList: () => {
    const url = `system/dict/data/type/topic_tags`;
    return tokenRequest(url, 'GET', '')
  },
  //获取话题列表
 getTopicList: () => {
  return tokenRequest('xhlj/topic/list', 'GET', '')
},
  //获取大会日程
getxhljMeetingScheduleList: () => {
  return tokenRequest('xhlj/meetingSchedule/list', 'GET', '')
},
getProductList:(enterpriseId)=>{
  const url = `xhlj/enterpriseProduct/list?enterpriseId=${enterpriseId}`;
  return tokenRequest(url, 'GET', '')
},
getPoster:(activityId)=>{
  const url = `xhlj/activity/poster/${activityId}`;
  return tokenRequest(url, 'GET', '')
},
getPrductById:(productId)=>{
  const url = `xhlj/enterpriseProduct/${productId}`;
  return tokenRequest(url, 'GET', '')
},
getProductFeedBack(productId){
  const url = `xhlj/productFeedback/list?enterpriseProductId=${productId}`;
  return tokenRequest(url, 'GET', '')
},
getCollect(activityId){
  const url = `xhlj/topicActivityCollect/list?activityId=${activityId}&createBy=3`;
  return tokenRequest(url, 'GET', '')
},
getCollectByEnterpriseId(enterpriseId){
  const url = `xhlj/topicActivityCollect/list?enterpriseId=${enterpriseId}&createBy=3`;
  return tokenRequest(url, 'GET', '')
},
updateCollect(data){
  const url = `xhlj/topicActivityCollect`;
  return tokenRequest(url, 'PUT', data)
},
addCollect(data){
  const url = `xhlj/topicActivityCollect`;
  return tokenRequest(url, 'POST', data)
},
getSmsCode(phonenumber){
  const url = `resource/sms/code?phonenumber=${phonenumber}`;
  return tokenRequest(url, 'GET', '')
},
getActivityCollect(){
  const url = `xhlj/topicActivityCollect/list?createBy=3`;
  return tokenRequest(url, 'GET', '')
},
addTopic(data){
  const url = `xhlj/topic`;
  return tokenRequest(url, 'POST', data)
},
getGoods(){
  const url = `xhlj/goods/list`;
  return tokenRequest(url, 'GET', '')
},
buyGood(){
  const url = `xhlj/goodsRedemptionRecords`;
  return tokenRequest(url, 'POST', data)
},
getUserInfo(createBy){
  const url = `wx/user/${createBy}`;
  return tokenRequest(url, 'GET', '')
},
getActivityRegistration(createBy){
  const url = `pay/activityRegistration/list?createBy=${createBy}`;
  return tokenRequest(url, 'GET', '')
},
getActivityChatList(activityId){
  const url = `xhlj/activityDiscussion/list?activityId=${activityId}`;
  return tokenRequest(url, 'GET', '')
},
addActivityChat(data){
  const url = `xhlj/activityDiscussion`;
  return tokenRequest(url, 'POST', data)
},
addProductFeedBack(data){
  const url = `xhlj/productFeedback`;
  return tokenRequest(url, 'POST', data)
},
getDataCenterList(){
  const url = `xhlj/dataCenter/list`;
  return tokenRequest(url, 'GET', '')
},
updataUserInfo(data){
  const url = `wx/user`;
  return tokenRequest(url, 'PUT', data)
},
// 活动报名
addActivityRegistration(data){
  const url = `pay/activityRegistration`;
  return tokenRequest(url, 'POST', data)
},
}
